Skip to content

Conversation

@alexcrichton
Copy link
Member

Helps to make the MachineEnvs in Wasmtime const-allocatable.

Closes #252

Helps to make the `MachineEnv`s in Wasmtime `const`-allocatable.
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch for working on this!

Use `offset_hint` as a mask start rather than looking for the Nth bit
set. Should in theory have the same overall desired balancing semantics
but enables more bit-tricks.
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Test tweak but otherwise LGTM.

src/lib.rs Outdated
let p0 = PReg::new(0, Int);
let p1 = PReg::new(1, Int);
let p2 = PReg::new(2, Int);
let p3 = PReg::new(3, Int);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we tweak these test values to exist in the various limbs?

64 regs per class, and class is put in the upper bits, and limbs are 64 bits each, so maybe something like (0, Int), (5, Float), (23, Vector), (63, Vector) or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Pushed up with some more tests, but if you're thinking of other kinds of tests I'm happy to add more too

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cfallin cfallin merged commit fbe1825 into bytecodealliance:main Jan 21, 2026
6 checks passed
@cfallin
Copy link
Member

cfallin commented Jan 21, 2026

If you want to do a version-bump PR (this is a semver break so 0.14.0 would be next) I'm happy to merge and then do a release (over here in RA2-land I just cargo publish locally; happy to take PRs if someone wants to update that too...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make MachineEnv statically allocatable by using PRegSet

2 participants